package cn.pubinfo.service.impl;

import cn.pubinfo.dao.RolePermissionMapper;
import cn.pubinfo.model.RolePermission;
import cn.pubinfo.model.RolePermissionExample;
import cn.pubinfo.service.RolePermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by zck on 2017/8/22.
 */
@Service
public class RolePermissionServiceImpl implements RolePermissionService{
    @Resource
    private RolePermissionMapper rolePermissionMapper;

    @Override
    public List<RolePermission> listByRole(String role) {
        RolePermissionExample example = new RolePermissionExample();
        RolePermissionExample.Criteria criteria = example.createCriteria();
        criteria.andRoleEqualTo(role);
        return rolePermissionMapper.selectByExample(example);
    }
}
